import { request } from "umi";

// 分页查询制造商列表
export async function listManufacturerByPage(body: RequestParam<API.ManufacturerDTO>, options?: { [key: string]: any }) {
  return request<BaseResponse<IPage<API.ManufacturerVO>>>('/api/manufacturer/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}

export async function listAllManufacturer() {
  return request<BaseResponse<IPage<API.Manufacturer>>>('/api/manufacturer/listAll', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    }
  });
}

// 添加制造商
export async function addManufacturer(body: API.ManufacturerDTO) {
  return request<BaseResponse<boolean>>('/api/manufacturer/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}
